package com.xm.servlet.background.home;

import com.xm.service.background.MattersService;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 根据Id删除事项表数据
 * @author 康文程
 * @date 2024-1-22 下午 02:18
 */
@WebServlet("/background/delete/matter/by/id")
public class DeleteMatterByIdServlet extends HttpServlet {
    /**
     * 事项Service
     */
    private final MattersService service = new MattersService();
    @SneakyThrows
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)  {
        resp.getWriter().print(service.deleteMatterById(Integer.parseInt(req.getParameter("mattersId"))));
    }
}
